Ext.define('Admin.store.PageStore', {
    extend: 'Ext.data.Store',
    alias: 'store.PageStore',

    listeners:{
    	beforeload:function( store, operation, eOpts ){
    		if(store.pageSize==0)
    			return false;
    	}
    },
    constructor: function(config) {
        var me = this;
        var opts={
        	model: config.model,
            sorters: [{
                property: 'id',
                direction: 'DESC'
            }],
            pageSize: 10,
            autoLoad: false,
            remoteFilter: true,
            remoteSort: true,
            proxy : {
                type: 'rest',
                url:  '/list/' + config.model,
                reader :
                {
                    type : 'json',
                    rootProperty : 'data',
                    totalProperty:'total'
                }
            }
        }
        me.callParent([Ext.apply(opts,config)]);
    },
    getById111: function(id) {
        var result = this.data.findBy(function(record) {
            return record.getId() === id;
        });
        return result;
    }


});